﻿<div class="bjui-pageHeader">
    <form id="pagerForm" data-toggle="ajaxsearch" action="${request.getContextPath()}/inOutPut/inOutPut"
          method="post">
        <div class="bjui-searchBar">
            <g:hiddenField name="SYS_QUERY_NAME" value="inOutPut"/>
            <g:hiddenField name="EXPORT_CONTENT_NAME" value="Excel"/>
            <label>封装形式：</label>
            %{--<input name='RESERVED1' value="${RESERVED1}"/>--}%
            <g:select name="RESERVED1" from="${packageForm}" data-toggle="selectpicker" data-width="180"
                      data-live-search="true" optionKey="RESERVED1" optionValue="RESERVED1" value="${RESERVED1}"
                      noSelection="['': '--ALL--']"/>&nbsp;
            <label>产品名称：</label>
            %{--<input name='part_name' value="${part_name}"/>--}%
            <g:select name="part_name" from="${partNameList}" data-toggle="selectpicker" data-width="180"
                      data-live-search="true" optionKey="PART_NAME" optionValue="PART_NAME" value="${part_name}"
                      noSelection="['': '--ALL--']"/>
            <label>芯片名称：</label>
            <input name='CUSTOMER_PART_ID' value="${CUSTOMER_PART_ID}"/>
            <label>扩散批号：</label>
            <input name='SUBSTRATE_ID1' value="${SUBSTRATE_ID1}"/>
            <br/>
            <label>客户订单：</label>
            <input name='CUSTOMER_ORDER' value="${CUSTOMER_ORDER}" size="18"/>
            <label>开始日期<strong><span class="text-danger">*</span></strong>：</label>
            <input type="text" name="startTime" class="form-control"
                   data-toggle="datepicker" data-pattern="yyyy-MM-dd HH:mm:ss"
                   size="18" id="start-date-input" readonly value="${startTime.format('yyyy-MM-dd HH:mm:ss')}">&nbsp;
            <label>结束日期<strong><span class="text-danger">*</span></strong>：</label>
            <input type="text" name="endTime" class="form-control"
                   data-toggle="datepicker" data-pattern="yyyy-MM-dd HH:mm:ss"
                   size="18" id="end-date-input" readonly value="${endTime.format('yyyy-MM-dd HH:mm:ss')}">&nbsp;
            <button type="submit" class="btn-default" data-icon="search">查询</button>&nbsp;
            <button type="button" class="btn-blue"
                    onclick="javascript:bjuiExportExl('#pagerForm', '${request.getContextPath()}/inOutPut/exportExcel')"
                    data-icon="file-excel-o" title="导出Excel">导出Excel文件</button>&nbsp;

        </div>
    </form>
</div>
%{--
<div class="bjui-pageContent">
    <table  data-toggle="tablefixed" data-width="100%" data-nowrap="true">
            <thead>
            <tr>
                <th width="60">NO.</th>
                <th width="150">下线日期</th>  START_TIME
                <th width="80">封装类型</th> RESERVED1
                <th width="150">产品名称</th>  PART_NAME
                <th width="110">芯片名称</th> CUSTOMER_PART_ID
                <th width="100">扩散批号</th> SUBSTRATE_ID1
                <th width="150">订单号</th>  CUSTOMER_ORDER
                <th width="110">装片投入数量(K)</th> ZPIN
                <th width="110">装片产出数量(K)</th> ZPOUT
                <th width="120">入库良品数(Kpcs)</th> GOOD_QTY
                <th width="120">入库不良品数(Kpcs)</th> NG_QTY
                <th width="100">入库数量(Kpcs)</th>  SHIP_QTY
                <th width="60">上芯率</th> SXL
                <th width="80">封装良率</th> pack_aty
                <th width="80">测试良率</th>test_aty
                <th width="80">封测良率</th> OUTIN
                <th width="80">封回率</th> FHL
                <th width="80">周记</th> RESERVED4
            </tr>
            </thead>
            <g:each in="${inOutPut}" status="i" var="tableInstance">
                <tr  style="background-color:
                  <g:if test="${tableInstance.RUKULV  >=98}">
                        #FF0000
                    </g:if>
                ">
                    <td  width="60">${i+1}</td>
                    <td width="120" class="xl70">${tableInstance.START_TIME}</td>
                    <td width="150">${tableInstance.RESERVED1}</td>
                    <td width="150">${tableInstance.PART_NAME}</td>
                    <td width="80">${tableInstance.CUSTOMER_PART_ID}</td>
                    <td width="80">${tableInstance.SUBSTRATE_ID1}</td>
                    <td width="100">${tableInstance.CUSTOMER_ORDER}</td>
                    <td width="80">${tableInstance.ZPIN}</td>
                    <td width="80">${tableInstance.ZPOUT}</td>
                    <td width="120">${tableInstance.GOOD_QTY}</td>
                    <td width="120">${tableInstance.NG_QTY}</td>
                    <td width="100">${tableInstance.SHIP_QTY}</td>
                    <td width="100">${tableInstance.SXL}</td>
                    <td width="80">${tableInstance.pack_aty}</td>
                    <td width="80">${tableInstance.test_aty}</td>
                    <td width="80">${tableInstance.OUTIN}</td>
                    <td width="80">${tableInstance.FHL}</td>
                    <td width="80">${tableInstance.RESERVED4}</td>

                </tr >
            </g:each>
            </tbody>
        </table>
    </div>
<g:render template="../template/pagination" />
<script>
    $(function(){
        for(var i=0;i<${inOutPut.size()};i++){
            var lotStayTime="LOTSTAYTIME"+i;
            var lotStayJudge=$("td[name='"+lotStayTime+"']").text()
            if(lotStayJudge>=98){
                $("td[name='"+lotStayTime+"']").css("background-color","#FF0000")
                $("td[name='"+lotStayTime+"']").nextAll().css("background-color","#FF0000")
                $("td[name='"+lotStayTime+"']").prevAll().css("background-color","#FF0000")
            }
        }
    })
</script>--}%



<div class="bjui-pageContent">
    <table data-toggle="tablefixed" data-width="100%" data-nowrap="true">
        <thead>
        <tr>
            <th width="40">NO.</th>
            <th width="150">下线日期</th>
            <th width="70">封装类型</th>
            <th width="140">产品名称</th>
            <th width="110">芯片名称</th>
            <th width="90">扩散批号</th>
            <th width="50">周记</th>
            <th width="150">订单号</th>
            <th width="110">装片投入数量(K)</th>
            <th width="110">装片产出数量(K)</th>
            <th width="120">入库良品数(Kpcs)</th>
            <th width="130">入库不良品数(Kpcs)</th>
            <th width="100">入库数量(Kpcs)</th>
            <th width="60">上芯率</th>
            <th width="80">封装良率</th>
            <th width="80">电基不良数</th>
            <th width="80">新洁能不良数</th>
            <th width="80">测试良率</th>
            <th width="80">封测良率</th>
            <th width="80">封回率</th>
        </tr>
        </thead>
        <tbody>
        <g:each in="${inOutPut}" status="i" var="dataInstance">
            <tr>
                <td>${i + 1}</td>
                <g:each in="${tableHeadList}" status="j" var="headInstance">
                    <g:if test="${headInstance == 'RUKULV'}">
                        <td name="LOTSTAYTIME${i}" style="visibility:hidden">${dataInstance["${headInstance}"]}</td>
                    </g:if>
                    <g:elseif test="${headInstance == 'RUKULV_TIME'}">
                        <td name="LOTSTAYT${i}" style="visibility:hidden">${dataInstance["${headInstance}"]}</td>
                    </g:elseif>
                    <g:elseif test="${headInstance == 'DOC_STATUS'}">
                        <td name="LOTSTAA${i}"  style="visibility:hidden">${dataInstance["${headInstance}"]}</td>
                    </g:elseif>
                    <g:elseif test="${headInstance != 'RN'}">
                        <td>${dataInstance["${headInstance}"]}</td>
                    </g:elseif>
                </g:each>
            </tr>
        </g:each>
        </tbody>
    </table>
</div>

<g:render template="../template/pagination"/>
<script>
    for (var i = 0; i <${inOutPut.size()}; i++) {
        var lotStayTime = "LOTSTAYTIME" + i;
        var lotStayJudge = parseFloat($("td[name='" + lotStayTime + "']").text())
        var lotStayTime2 = "LOTSTAA" + i;
        var lotStayJudge2 = parseFloat($("td[name='" + lotStayTime2 + "']").text())
        if (lotStayJudge2 = "APPROVED" && lotStayJudge >= 98) {
            $("td[name='" + lotStayTime + "']").css("background-color", "#90EE90")
            $("td[name='" + lotStayTime + "']").nextAll().css("background-color", "#90EE90")
            $("td[name='" + lotStayTime + "']").prevAll().css("background-color", "#90EE90")
        }
        if (lotStayJudge2 =="COMPLETED") {
            $("td[name='" + lotStayTime2 + "']").css("background-color", "#808080")
            $("td[name='" + lotStayTime2 + "']").nextAll().css("background-color", "#808080")
            $("td[name='" + lotStayTime2 + "']").prevAll().css("background-color", "#808080")
        }
        var lotStayTime1 = "LOTSTAYT" + i;
        var lotStayJudge1 = parseFloat($("td[name='" + lotStayTime1 + "']").text())
        if (lotStayJudge < 98 && lotStayJudge1 >= 15) {
            $("td[name='" + lotStayTime1 + "']").css("background-color", "#FFFF00")
            $("td[name='" + lotStayTime1 + "']").nextAll().css("background-color", "#FFFF00")
            $("td[name='" + lotStayTime1 + "']").prevAll().css("background-color", "#FFFF00")
        }


    }

</script>